package com.btn.token.utils;

public class ResultUtil {
    public static final int SUCCESS_CODE_200 = 200;
    public static final int ERROR_CODE_500 = 500;
    //当正确时返回的值
    public static Result success(Integer code,Object data){
        Result result = new Result();
        result.setCode(code);
        result.setMsg("OK");
        result.setData(data);
        return result;
    }

    public static Result success(){
        return success(SUCCESS_CODE_200,null);
    }

    //当错误时返回的值
    public static Result error(int code,String msg){
        Result result = new Result();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }
}
